package model.agent.mapper;


import model.agent.entity.Agent;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.domain.Sort;



import java.util.List;

/**
 * Created by Administrator on 2019/6/23.
 */
@Mapper
public interface AgentMapper {
    @Select("select * from Agent where id=#{id}")
    Agent getById(String id);
//    @Insert("insert into Agent values(#{id},#{name},#{tel},#{picture_id},#{address},)")
//    void save(Agent agent);
    @Select("select * from Agent  ")
    List<Agent> findall();
    @Select("select * from Agent where address like concat('%',#{address},'%')")
    List<Agent> getByAddress(String address);
    @Delete("delete from Agent where name=#{name}")
    void  del(String name);

    @Select("select * from Agent where name like concat('%',#{name},'%') or address like concat('%',#{address},'%')")
    List<Agent> find(Agent agent);
   //按照综合评分排序
    @Select("Select * From agent where overallscore>=4.5")
    List<Agent> findsort();


}
